home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / mg2a_src.zip / SYS / AMIGA / AMIGA_MA.C < prev    next >
C/C++ Source or Header  |  1988-08-23  |  4KB  |  122 lines

  1. /*
  2.  * Name:    MG 2a
  3.  *        keymap.c setup for Amiga-specific function keys.
  4.  * Created:    14-May-1988 Mic Kaczmarczik (mic@emx.utexas.edu)
  5.  * Last edit:    14-May-1988 Mic Kaczmarczik
  6.  *
  7.  * One big table for coding convenience, because the number of different
  8.  * compilation possibilities makes setting up data structures kind of
  9.  * tricky.  Once again for convenience, the file is #included into keymap.c
  10.  * instead of being linked.  I tried to minimize the changes to keymap.c,
  11.  * while making it possible to have the Amiga function/arrow keys in dired
  12.  * mode as well as fundamental mode.  In the future, we might want to
  13.  * rebind some of the function keys in dired mode, but for right now they
  14.  * do the same thing as in fundamental mode.
  15.  */
  16.  
  17. static    PF    amiga_keys[] = {
  18. #ifdef    FKEYS
  19.     backline,    /* Up            (0x100)    */
  20.     forwline,    /* Down                */
  21.     backchar,    /* Left                */
  22.     forwchar,    /* Right            */
  23.     gotobop,    /* Shift-Up            */
  24.     gotoeop,    /* Shift-Down            */
  25.     backword,    /* Shift-Left            */
  26.     forwword,    /* Shift-Right            */
  27.     desckey,    /* Help            (0x108)    */
  28. #else
  29.     /* 9 unbound keys */
  30.     rescan, rescan, rescan, rescan, rescan, rescan, rescan, rescan, rescan, 
  31. #endif
  32.  
  33. #ifdef    DO_MENU
  34.     amigamenu,    /* Menu selction    (0x109)    */
  35. #else
  36.     rescan,        /* Menu selection    (0x109)    */
  37. #endif
  38.     refresh,    /* Resize window    (0x10A)    */
  39.     rescan,        /* used to be Mouse        */
  40.  
  41. #ifdef    FKEYS
  42.     filevisit,    /* F1            (0x10C)    */
  43.     filesave,    /* F2                */
  44.     forwpage,    /* F3                */
  45.     enlargewind,    /* F4                */
  46.     fillpara,    /* F5                */
  47.     splitwind,    /* F6                */
  48.     twiddle,    /* F7                */
  49.     definemacro,    /* F8                */
  50.     executemacro,    /* F9                */
  51.     listbuffers,    /* F10                */
  52.     poptofile,    /* Shift-F1        (0x116)    */
  53.     filewrite,    /* Shift-F2            */
  54.     backpage,    /* Shift-F3            */
  55.     shrinkwind,    /* Shift-F4            */
  56.     queryrepl,    /* Shift-F5            */
  57.     onlywind,    /* Shift-F6            */
  58.     justone,    /* Shift-F7            */
  59.     finishmacro,    /* Shift-F8            */
  60.     wallchart,    /* Shift-F9            */
  61.     quit,        /* Shift-F10        (0x11F)    */
  62. #else
  63.     rescan, rescan, rescan, rescan, rescan,    /* 20 unbound keys */
  64.     rescan, rescan, rescan, rescan, rescan,
  65.     rescan, rescan, rescan, rescan, rescan,
  66.     rescan, rescan, rescan, rescan, rescan,
  67. #endif
  68.  
  69. #ifdef    MOUSE
  70.     amigamouse,    /* Mouse        (0x120)    */
  71.     mforwdel,    /* Ctrl-Mouse            */
  72.     mreposition,    /* Shift-Mouse            */
  73.     mdelwhite,    /* Shift-Ctrl-Mouse        */
  74.     mdelfword,    /* Meta-Mouse            */
  75.     mkillregion,    /* Meta-Ctrl-Mouse        */
  76.     mkillline,    /* Meta-Shift-Mouse        */
  77.     myank,        /* Meta-Shift-Ctrl-Mouse    */
  78.     mforwpage,    /* Mode-Mouse        (0x128)    */
  79.     mgotobob,    /* Ctrl-Mode-Mouse        */
  80.     mbackpage,    /* Shift-Mode-Mouse        */
  81.     mgotoeob,    /* Shift-Ctrl-Mode-Mouse    */
  82.     msplitwind,    /* Meta-Mode-Mouse        */
  83.     menlargewind,    /* Meta-Ctrl-Mode-Mouse        */
  84.     mdelwind,    /* Meta-Shift-Mode-Mouse    */
  85.     mshrinkwind,    /* Meta-Shift-Ctrl-Mode-Mouse    */
  86. #ifdef    DO_ICONIFY
  87.     tticon,        /* Echo-Mouse        (0x130)    */
  88. #else
  89.     usebuffer,    /* Echo-Mouse        (0x130)    */
  90. #endif
  91.     spawncli,    /* Ctrl-Echo-Mouse        */
  92.     killbuffer,    /* Shift-Echo-Mouse        */
  93.     quit,        /* Shift-Ctrl-Echo-Mouse    */
  94.     desckey,    /* Meta-Echo-Mouse        */
  95.     listbuffers,    /* Meta-Ctrl-Echo-Mouse        */
  96.     wallchart,    /* Meta-Shift-Echo-Mouse    */
  97.     togglewindow,    /* Meta-Shift-Ctrl-Echo-Mouse    */
  98. #endif    MOUSE
  99. };
  100.  
  101.  
  102. /*
  103.  * Define extra maps for fundamental mode.  Have to provide the number of
  104.  * extra map segments because it's used by the KEYMAPE() macro that builds
  105.  * keymaps.  The keymap setup, while compact, is pretty complex...
  106.  */
  107.  
  108. #define    NFUND_XMAPS    1
  109.  
  110. #ifdef    MOUSE
  111. #define    FUND_XMAPS    {KUP,    KEASCMOUSE,    amiga_keys,    (KEYMAP*)NULL}
  112. #else
  113. #define    FUND_XMAPS    {KUP,    KSF10,        amiga_keys,    (KEYMAP*)NULL}
  114. #endif
  115.  
  116. /*
  117.  * Extra map segments for dired mode -- just use fundamental mode segments
  118.  */
  119. #define    NDIRED_XMAPS    NFUND_XMAPS
  120. #define    DIRED_XMAPS    FUND_XMAPS
  121.  
  122.